<?php

namespace Caisse\CaisseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Serveur
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Caisse\CaisseBundle\Entity\ServeurRepository")
 */
class Serveur
{
  /**
     * @ORM\OneToMany(targetEntity="Caisse\CaisseBundle\Entity\Tables", mappedBy="serveur" )
     */
    private $tables;
    
         /**
     * @ORM\OneToMany(targetEntity="Caisse\CaisseBundle\Entity\Commande", mappedBy="serveur" , cascade={"remove"})
     */
    private $commandes;
             /**
     * @ORM\OneToMany(targetEntity="Caisse\CaisseBundle\Entity\SessionCaisse", mappedBy="serveur")
     */
    private $sessionCaisses;
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;
        /**
     * @var boolean
     *
     * @ORM\Column(name="etatServeur", type="boolean")
     */
    private $etatServeur;

    /**
     * @var string
     *
     * @ORM\Column(name="prenom", type="string", length=255)
     */
    private $prenom;

    /**
     * @var string
     *
     * @ORM\Column(name="Adresse", type="text")
     */
    private $adresse;

    /**
     * @var integer
     *
     * @ORM\Column(name="tel", type="integer")
     */
    private $tel;

    /**
     * @var string
     *
     * @ORM\Column(name="username", type="string", length=255)
     */
    private $username;

    /**
     * @var string
     *
     * @ORM\Column(name="password", type="string", length=255)
     */
    private $password;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Serveur
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }

    /**
     * Set prenom
     *
     * @param string $prenom
     * @return Serveur
     */
    public function setPrenom($prenom)
    {
        $this->prenom = $prenom;
    
        return $this;
    }

    /**
     * Get prenom
     *
     * @return string 
     */
    public function getPrenom()
    {
        return $this->prenom;
    }
        public function __toString() {
        return $this->getUsername();
    }

    /**
     * Set adresse
     *
     * @param string $adresse
     * @return Serveur
     */
    public function setAdresse($adresse)
    {
        $this->adresse = $adresse;
    
        return $this;
    }

    /**
     * Get adresse
     *
     * @return string 
     */
    public function getAdresse()
    {
        return $this->adresse;
    }

    /**
     * Set tel
     *
     * @param integer $tel
     * @return Serveur
     */
    public function setTel($tel)
    {
        $this->tel = $tel;
    
        return $this;
    }

    /**
     * Get tel
     *
     * @return integer 
     */
    public function getTel()
    {
        return $this->tel;
    }

    /**
     * Set username
     *
     * @param string $username
     * @return Serveur
     */
    public function setUsername($username)
    {
        $this->username = $username;
    
        return $this;
    }

    /**
     * Get username
     *
     * @return string 
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * Set password
     *
     * @param string $password
     * @return Serveur
     */
    public function setPassword($password)
    {
        $this->password = $password;
    
        return $this;
    }

    /**
     * Get password
     *
     * @return string 
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->commandes = new \Doctrine\Common\Collections\ArrayCollection();
        $this->etatServeur = true;
    }
    
    /**
     * Add commandes
     *
     * @param \Caisse\CaisseBundle\Entity\Commande $commandes
     * @return Serveur
     */
    public function addCommande(\Caisse\CaisseBundle\Entity\Commande $commandes)
    {
        $this->commandes[] = $commandes;
    
        return $this;
    }

    /**
     * Remove commandes
     *
     * @param \Caisse\CaisseBundle\Entity\Commande $commandes
     */
    public function removeCommande(\Caisse\CaisseBundle\Entity\Commande $commandes)
    {
        $this->commandes->removeElement($commandes);
    }

    /**
     * Get commandes
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCommandes()
    {
        return $this->commandes;
    }

    /**
     * Add sessionCaisses
     *
     * @param \Caisse\CaisseBundle\Entity\SessionCaisse $sessionCaisses
     * @return Serveur
     */
    public function addSessionCaisse(\Caisse\CaisseBundle\Entity\SessionCaisse $sessionCaisses)
    {
        $this->sessionCaisses[] = $sessionCaisses;
    
        return $this;
    }

    /**
     * Remove sessionCaisses
     *
     * @param \Caisse\CaisseBundle\Entity\SessionCaisse $sessionCaisses
     */
    public function removeSessionCaisse(\Caisse\CaisseBundle\Entity\SessionCaisse $sessionCaisses)
    {
        $this->sessionCaisses->removeElement($sessionCaisses);
    }

    /**
     * Get sessionCaisses
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getSessionCaisses()
    {
        return $this->sessionCaisses;
    }

    /**
     * Set etatServeur
     *
     * @param boolean $etatServeur
     * @return Serveur
     */
    public function setEtatServeur($etatServeur)
    {
        $this->etatServeur = $etatServeur;
    
        return $this;
    }

    /**
     * Get etatServeur
     *
     * @return boolean 
     */
    public function getEtatServeur()
    {
        return $this->etatServeur;
    }

    /**
     * Set table
     *
     * @param \Caisse\CaisseBundle\Entity\Tables $table
     * @return Serveur
     */
    public function setTable(\Caisse\CaisseBundle\Entity\Tables $table = null)
    {
        $this->table = $table;
    
        return $this;
    }

    /**
     * Get table
     *
     * @return \Caisse\CaisseBundle\Entity\Tables 
     */
    public function getTable()
    {
        return $this->table;
    }

    /**
     * Add tables
     *
     * @param \Caisse\CaisseBundle\Entity\Tables $tables
     * @return Serveur
     */
    public function addTable(\Caisse\CaisseBundle\Entity\Tables $tables)
    {
        $this->tables[] = $tables;
    
        return $this;
    }

    /**
     * Remove tables
     *
     * @param \Caisse\CaisseBundle\Entity\Tables $tables
     */
    public function removeTable(\Caisse\CaisseBundle\Entity\Tables $tables)
    {
        $this->tables->removeElement($tables);
    }

    /**
     * Get tables
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getTables()
    {
        return $this->tables;
    }
}